home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1997 #3
/
Amiga Plus CD - 1997 - No. 03.iso
/
pd
/
programmierung
/
alienbreed3d2_src
/
cheesesauce
/
slaveanims
< prev
next >
Wrap
Text File
|
1997-01-31
|
10KB
|
693 lines
realtab:
dc.l prot1-78935450
dc.l prot2-78935450
dc.l prot3-78935450
dc.l prot4-78935450
dc.l prot5-78935450
dc.l prot6-78935450
dc.l prot7-78935450
dc.l prot8-78935450
dc.l prot9-78935450
dc.l protA-78935450
objvels: ds.l 8
Conditions: dc.w 0
Robotanimpos:
dc.w 0
Robotarmpos
dc.w 0
clump: dc.w 0
SLAVERobotWalk:
move.l #RobotPts+2,a0
move.l #Robotanim,a1
move.w Robotanimpos(pc),d0
clr.b clump
adda.w d0,a1
move.w #(38*3)-1,d0
putinpts:
move.w (a1)+,(a0)+
dbra d0,putinpts
move.l #RightArm,a0
move.l #Armanim,a1
move.w Robotarmpos(pc),d0
adda.w d0,a1
move.w #(14*3)-1,d0
putinpts2:
move.w (a1)+,(a0)+
dbra d0,putinpts2
move.l #Robot_MainBody,a0
move.l #BodyPlace+2,a1
move.w (a0)+,d0
move.w RobotPts+4+14*6,d1
add.w RobotPts+4+22*6,d1
asr.w #1,d1
putinheights:
move.w (a0)+,d2
add.w d1,d2
move.w d2,(a1)
addq #6,a1
dbra d0,putinheights
move.w visxpos,d0
add.w visxdir,d0
cmp.w #24,d0
blt.s okvisr
move.w #-4,visxdir
okvisr
cmp.w #-24,d0
bgt.s okvisl
move.w #4,visxdir
okvisl:
move.w d0,visxpos
move.l #VISOR,a0
add.w #64,d0
move.b d0,6(a0)
move.b d0,18(a0)
move.b d0,22(a0)
add.b #63,d0
move.b d0,10(a0)
move.b d0,14(a0)
rts
visxpos: dc.w 0
visxdir: dc.w 4
FramesToDraw: dc.w 0
TempFrames: dc.w 0
SLAVEANIM:
move.l PLR1_Roompt,a0
move.w (a0),PLR1_Zone
move.l PLR2_Roompt,a0
move.w (a0),PLR2_Zone
bsr SLAVESwitchRoutine
bsr SLAVEDoorRoutine
bsr SLAVELiftRoutine
; bsr ObjectHandler
bsr SLAVERobotWalk
rts
******************************
tstdir: dc.w 0
liftheighttab: ds.w 20
doorheighttab: ds.w 20
stoodonlift: dc.b 0
liftattop: dc.b 0
liftatbot: dc.b 0
ZoneBrightTable:
ds.l 300
even
SLAVELiftRoutine:
move.l LiftData,a0
move.l #liftheighttab,a6
doalift:
move.w (a0)+,d0 ; bottom of lift movement
cmp.w #999,d0
bne notallliftsdone
move.w #999,(a6)
rts
notallliftsdone:
move.w (a0)+,d1 ; top of lift movement.
move.w (a0),d3
move.w d3,(a6)+
move.w 2(a0),d2
move.w d2,d7
muls TempFrames,d2
add.w d2,d3
move.w 2(a0),d2
cmp.w d3,d0
sle.s liftatbot
bgt.s .nolower
moveq #0,d2
move.w d0,d3
.nolower:
cmp.w d3,d1
sge.s liftattop
blt.s .noraise
moveq #0,d2
move.w d1,d3
.noraise:
sub.w d3,d0
cmp.w #15*16,d0
slt d6
move.w d3,(a0)+
move.l a0,a5
move.w d2,(a0)+
move.w d2,d7
move.l (a0)+,a1
add.l #LEVELGRAPHICS,a1
asr.w #2,d3
move.w d3,d0
asl.w #2,d0
move.w d0,2(a1)
move.w d3,d0
muls #256,d3
move.w (a0)+,d5
move.l ZoneAdds,a1
move.l (a1,d5.w*4),a1
add.l #LEVELDATA,a1
move.w (a1),d5
move.l PLR1_Roompt,a3
move.l d3,2(a1)
and.w #63,d0
neg.w d0
add.w #64,d0
cmp.w (a3),d5
sne.s stoodonlift
move.w (a0)+,d2 ; conditions
and.w Conditions,d2
cmp.w -2(a0),d2
beq.s .satisfied
move.w (a0)+,d5
.dothesimplething:
move.l FloorLines,a3
.simplecheck:
move.w (a0)+,d5
blt nomoreliftwalls
asl.w #4,d5
lea (a3,d5.w),a4
move.w #0,14(a4)
move.l (a0)+,a1
add.l #LEVELGRAPHICS,a1
move.l (a0)+,a2
adda.w d0,a2
move.l a2,10(a1)
move.l d3,20(a1)
bra.s .simplecheck
bra nomoreliftwalls
.satisfied:
move.l FloorLines,a3
moveq #0,d4
moveq #0,d5
move.b (a0)+,d4
move.b (a0)+,d5
tst.b liftattop
bne tstliftlower
tst.b liftatbot
bne tstliftraise
backfromlift
liftwalls:
move.w (a0)+,d5
blt nomoreliftwalls
asl.w #4,d5
lea (a3,d5.w),a4
move.w 14(a4),d4
move.w #0,14(a4)
and.w d1,d4
cmp.w d1,d4
bne.s .nothinghit
move.w d7,(a5)
move.w #0,Noisex
move.w #0,Noisez
move.w #50,Noisevol
move.w #5,Samplenum
move.b #1,chanpick
st notifplaying
move.b #$fe,IDNUM
movem.l a0/a3/a4/d0/d1/d2/d3/d6/d7,-(a7)
jsr MakeSomeNoise
movem.l (a7)+,a0/a3/a4/d0/d1/d2/d3/d6/d7
.nothinghit:
move.l (a0)+,a1
add.l #LEVELGRAPHICS,a1
move.l (a0)+,a2
adda.w d0,a2
move.l a2,10(a1)
move.l d3,20(a1)
bra liftwalls
nomoreliftwalls
bra doalift
rts
tstliftlower:
cmp.b #1,d5
blt.s lift0
beq.s lift1
cmp.b #3,d5
blt.s lift2
beq.s lift3
lift0:
tst.b SPCTAP
bne.s lift1
move.w #$ffff,d1
bra backfromlift
lift1:
move.w #0,d1
tst.b stoodonlift
beq.s lift1b
move.w #%100000000,d1
lift1b:
move.w #4,d7
bra backfromlift
lift2:
move.w #0,d1
move.w #4,d7
bra backfromlift
lift3:
move.w #$ffff,d1
bra backfromlift
tstliftraise:
cmp.b #1,d4
blt.s rlift0
beq.s rlift1
cmp.b #3,d4
blt.s rlift2
beq.s rlift3
rlift0:
tst.b SPCTAP
bne.s rlift1
move.w #$ffff,d1
bra backfromlift
rlift1:
tst.b stoodonlift
bne.s rlift3
move.w #0,d1
move.w #-4,d7
bra backfromlift
rlift2:
move.w #0,d1
move.w #-4,d7
bra backfromlift
rlift3:
move.w #$ffff,d1
bra backfromlift
animtimer: dc.w 2
doordir: dc.w -1
doorpos: dc.w -9
dooropen: dc.b 0
doorclosed: dc.b 0
even
SLAVEDoorRoutine:
move.l #doorheighttab,a6
move.l DoorData,a0
doadoor:
move.w (a0)+,d0 ; bottom of door movement
cmp.w #999,d0
bne notalldoorsdone
move.w #999,(a6)+
rts
notalldoorsdone:
move.w (a0)+,d1 ; top of door movement.
move.w (a0),d3
move.w d3,(a6)+
move.w 2(a0),d2
muls TempFrames,d2
add.w d2,d3
move.w 2(a0),d2
cmp.w d3,d0
sle.s doorclosed
bgt.s nolower
moveq #0,d2
nolower:
cmp.w d3,d1
sge.s dooropen
blt.s noraise
moveq #0,d2
move.w d1,d3
noraise:
sub.w d3,d0
cmp.w #15*16,d0
sge d6
move.w d3,(a0)+
move.l a0,a5
move.w d2,(a0)+
move.w d2,d7
move.l (a0)+,a1
add.l #LEVELGRAPHICS,a1
asr.w #2,d3
move.w d3,d0
asl.w #2,d0
move.w d0,2(a1)
move.w d3,d0
muls #256,d3
move.l ZoneAdds,a1
move.w (a0)+,d5
move.l (a1,d5.w*4),a1
add.l #LEVELDATA,a1
move.l d3,6(a1)
and.w #63,d0
neg.w d0
add.w #64,d0
cmp.w PLR1_Zone,d5
bne.s NotGoBackUp
tst.w d2
blt.s NotGoBackUp
move.w #-16,d7
move.w #0,d1
move.w (a0)+,d2
move.w (a0)+,d5
bra backfromtst
NotGoBackUp:
move.w (a0)+,d2 ; conditions
and.w Conditions,d2
cmp.w -2(a0),d2
beq.s satisfied
move.w (a0)+,d5
dothesimplething:
move.l FloorLines,a3
simplecheck:
move.w (a0)+,d5
blt nomoredoorwalls
asl.w #4,d5
lea (a3,d5.w),a4
move.w #0,14(a4)
move.l (a0)+,a1
add.l #LEVELGRAPHICS,a1
move.l (a0)+,a2
adda.w d0,a2
move.l a2,10(a1)
move.l d3,24(a1)
bra.s simplecheck
bra nomoredoorwalls
satisfied:
moveq #0,d4
moveq #0,d5
move.b (a0)+,d5
move.b (a0)+,d4
tst.b dooropen
bne tstdoortoclose
tst.b doorclosed
bne tstdoortoopen
move.w #$ffff,d1
backfromtst:
move.l FloorLines,a3
doorwalls:
move.w (a0)+,d5
blt.s nomoredoorwalls
asl.w #4,d5
lea (a3,d5.w),a4
move.w 14(a4),d4
move.w #0,14(a4)
and.w d1,d4
cmp.w d1,d4
bne.s nothinghit
move.w d7,(a5)
move.w #0,Noisex
move.w #0,Noisez
move.w #50,Noisevol
move.w #5,Samplenum
move.b #1,chanpick
st notifplaying
move.b #$fd,IDNUM
movem.l a0/a3/d0/d1/d2/d3/d6,-(a7)
jsr MakeSomeNoise
movem.l (a7)+,a0/a3/d0/d1/d2/d3/d6
nothinghit:
move.l (a0)+,a1
add.l #LEVELGRAPHICS,a1
move.l (a0)+,a2
adda.w d0,a2
move.l a2,10(a1)
move.l d3,24(a1)
bra.s doorwalls
nomoredoorwalls
bra doadoor
rts
tstdoortoopen:
cmp.w #1,d5
blt.s door0
beq.s door1
cmp.w #3,d5
blt.s door2
beq.s door3
cmp.w #5,d5
blt.s door4
beq.s door5
door0:
tst.b SPCTAP
bne.s door1
move.w #$ffff,d1
bra backfromtst
door1:
move.w #%100000000,d1
move.w #-16,d7
bra backfromtst
door2:
move.w #%10000000000,d1
move.w #-16,d7
bra backfromtst
door3:
move.w #%1000000000,d1
move.w #-16,d7
bra backfromtst
door4:
move.w #0,d1
move.w #-16,d7
bra backfromtst
door5:
move.w #$ffff,d1
bra backfromtst
tstdoortoclose:
tst.w d4
beq.s dclose0
bra.s dclose1
dclose0:
move.w #4,d7
move.w #0,d1
bra backfromtst
dclose1:
move.w #$ffff,d1
bra backfromtst
SLAVESwitchRoutine:
tst.b SPCTAP
bne.s SpaceIsPressed
rts
SpaceIsPressed:
move.l SwitchData,a0
move.w #7,d0
move.l Points,a1
move.w PLR1_xoff,d1
move.w PLR1_zoff,d2
CheckSwitches:
move.w (a0),d3
blt NotCloseEnough
move.w 2(a0),d3
lea (a1,d3.w*4),a2
move.w (a2),d3
add.w 4(a2),d3
asr.w #1,d3
move.w 2(a2),d4
add.w 6(a2),d4
asr.w #1,d4
sub.w d1,d3
muls d3,d3
sub.w d2,d4
muls d4,d4
add.l d3,d4
cmp.l #60*60,d4
bge NotCloseEnough
move.l 4(a0),a3
add.l #LEVELGRAPHICS,a3
move.w 2(a3),d3
and.w #%1111000000111111,d3
not.b 8(a0)
beq.s switchoff
or.w #32*64,d3
switchoff:
move.w d3,2(a3)
move.w #7,d3
sub.w d0,d3
addq #4,d3
move.w Conditions,d4
bchg d3,d4
move.w d4,Conditions
movem.l a0/a1/d0,-(a7)
move.w #0,Noisex
move.w #0,Noisez
move.w #50,Noisevol
move.w #10,Samplenum
move.b #1,chanpick
st notifplaying
move.b #$fc,IDNUM
movem.l a0/a3/d0/d1/d2/d3/d6,-(a7)
jsr MakeSomeNoise
movem.l (a7)+,a0/a3/d0/d1/d2/d3/d6
movem.l (a7)+,a0/a1/d0
NotCloseEnough:
adda.w #12,a0
dbra d0,CheckSwitches
rts
prot1: dc.w 0
tempGotBigGun: dc.w 0
tempGunDamage: dc.w 0
tempGunNoise: dc.w 1
tempxoff: dc.w 0
tempzoff: dc.w 0
tempRoompt: dc.l 0
PLR1_GotBigGun: dc.w 0
PLR1_GunDamage: dc.w 0
PLR1_GunNoise: dc.w 0
PLR2_GotBigGun: dc.w 0
PLR2_GunDamage: dc.w 0
PLR2_GunNoise: dc.w 0
bulyspd: dc.w 0
closedist: dc.w 0
ObsInLine:
ds.b 400
rotcount:
dc.w 0
shotvels: ds.l 20
PLR1_clicked: dc.b 0
PLR2_clicked: dc.b 0
popping: ds.l 5*4
targetydiff: dc.l 0
TimeToShoot: dc.w 0
tempangpos: dc.w 0
tempxdir: dc.w 0
tempzdir: dc.w 0
GunFrame: dc.w 0
duh: dc.w 0
double: dc.w 0
ivescreamed: dc.w 0
putinbackdrop:
move.l a0,-(a7)
move.w PLR1_angpos,d5
and.w #8191,d5
muls #432,d5
divs #8192,d5
muls #38*2,d5
CACHE_ON d1
move.l frompt,a0
adda.w #104*4,a0
move.l #EndBackPicture,a3
lea.l BackPicture,a1
add.l d5,a1
move.w #2,d4
bra allbars
cnop 0,32
allbars:
move.w #31,d3
onebar:
vertline:
val SET 0
REPT 19
move.l (a1)+,d0
move.w d0,val+104*4(a0)
swap d0
move.w d0,val(a0)
val SET val+104*8
ENDR
cmp.l a3,a1
blt.s notoffrightend
move.l #BackPicture,a1
notoffrightend:
addq #4,a0
dbra d3,onebar
addq #4,a0
dbra d4,allbars
move.l (a7)+,a0
rts